/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "hos_cambio_turno_paciente")
@NamedQueries({
    @NamedQuery(name = "HosCambioTurnoPaciente.findAll", query = "SELECT h FROM HosCambioTurnoPaciente h")})
public class HosCambioTurnoPaciente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "htp_id")
    private Integer htpId;
    @Column(name = "htp_num_habitacion")
    private Integer htpNumHabitacion;
    @Column(name = "htp_hora")
    @Temporal(TemporalType.DATE)
    private Date htpHora;
    @Size(max = 2147483647)
    @Column(name = "htp_operaciones")
    private String htpOperaciones;
    @JoinColumn(name = "hin_id", referencedColumnName = "hin_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private HosInternacion hosInternacion;
    @JoinColumn(name = "hct_id", referencedColumnName = "hct_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private HosCambioTurno hosCambioTurno;

    public HosCambioTurnoPaciente() {
    }

    public HosCambioTurnoPaciente(Integer htpId) {
        this.htpId = htpId;
    }

    public Integer getHtpId() {
        return htpId;
    }

    public void setHtpId(Integer htpId) {
        this.htpId = htpId;
    }

    public Integer getHtpNumHabitacion() {
        return htpNumHabitacion;
    }

    public void setHtpNumHabitacion(Integer htpNumHabitacion) {
        this.htpNumHabitacion = htpNumHabitacion;
    }

    public Date getHtpHora() {
        return htpHora;
    }

    public void setHtpHora(Date htpHora) {
        this.htpHora = htpHora;
    }

    public String getHtpOperaciones() {
        return htpOperaciones;
    }

    public void setHtpOperaciones(String htpOperaciones) {
        this.htpOperaciones = htpOperaciones;
    }

    public HosInternacion getHosInternacion() {
        return hosInternacion;
    }

    public void setHosInternacion(HosInternacion hosInternacion) {
        this.hosInternacion = hosInternacion;
    }

    public HosCambioTurno getHosCambioTurno() {
        return hosCambioTurno;
    }

    public void setHosCambioTurno(HosCambioTurno hosCambioTurno) {
        this.hosCambioTurno = hosCambioTurno;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (htpId != null ? htpId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HosCambioTurnoPaciente)) {
            return false;
        }
        HosCambioTurnoPaciente other = (HosCambioTurnoPaciente) object;
        if ((this.htpId == null && other.htpId != null) || (this.htpId != null && !this.htpId.equals(other.htpId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.HosCambioTurnoPaciente[ htpId=" + htpId + " ]";
    }
    
}
